/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFAjustes.java
 *
 * Created on May 21, 2012, 2:11:29 PM
 */
package ajustes;

import java.util.Arrays;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author Jessica Ordoñez
 */
public class JFAjustes extends javax.swing.JFrame {

    private Conexion2 cnxDivs= new Conexion2() ;
    private Conexion2 cnxEmp = new Conexion2();
  //  private List<String[]> empresas =
           
    /** Creates new form JFAjustes */
    public JFAjustes() {
        initComponents();
        cnxEmp.llenarComboEmp(this);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cboDivisiones = new javax.swing.JComboBox();
        cboEmpresas = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        cboDivisiones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cboDivisiones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboDivisionesActionPerformed(evt);
            }
        });

        cboEmpresas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        cboEmpresas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cboEmpresasActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(cboEmpresas, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(cboDivisiones, javax.swing.GroupLayout.Alignment.LEADING, 0, 167, Short.MAX_VALUE))
                .addContainerGap(214, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(41, 41, 41)
                .addComponent(cboEmpresas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(cboDivisiones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(201, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void cboDivisionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboDivisionesActionPerformed
        // TODO add your handling code here:
        // JOptionPane.showMessageDialog(this, "He cambiado: " + cboDivisiones.getModel().getSelectedItem());
    }//GEN-LAST:event_cboDivisionesActionPerformed

    private void cboEmpresasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboEmpresasActionPerformed
        // TODO add your handling code here:

        // for (String[] emp : empresas) {

        // if (e[0].toString().equals(cboEmpresas.getSelectedItem())) {
        // cnxDivs = new Conexion2();
        // cnxDivs.llenarComboDivs(this);
        System.out.println("el id de la empresa es: ");
        // }
        //  }


        //JOptionPane.showMessageDialog(this, "He cambiado: " + cboEmpresas.getModel().getSelectedItem());

    }//GEN-LAST:event_cboEmpresasActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new JFAjustes().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JComboBox cboDivisiones;
    protected javax.swing.JComboBox cboEmpresas;
    // End of variables declaration//GEN-END:variables
}
